package com.android.quiz;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class Scores extends Activity {
	
	TextView Questions,Answered;
	Button Database, Alarm, Home;
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.scores);
        
        Initializer();
        Intent intent = getIntent();
        
        Questions.setText(intent.getStringExtra("Number"));
        Answered.setText(intent.getStringExtra("Score"));
        
    // A Listener for the Home button.
        Home.setOnClickListener(new OnClickListener() { public void onClick(View v) {  finish();  }  });
        
    // A Listener for the Alarm Button.
        
        Database.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {  startActivity(new Intent(Scores.this, GoogleDatabase.class));  }  });
        
    // A listener for the Database button.
        Alarm.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(Scores.this, Remainder.class));
			}
		});
        
        
	}

	private void Initializer() {
		Questions = (TextView) findViewById(R.id.displayedQuetions);
		Answered = (TextView) findViewById(R.id.answered);
		
		Database = (Button) findViewById(R.id.Database);
		Alarm = (Button) findViewById(R.id.alarm);
		Home = (Button) findViewById(R.id.home);
	}
	
}
